package cn.abcsys.cloud.devops.web.dao;

import java.sql.SQLException;
import java.util.List;

import org.apache.ibatis.annotations.Param;

import cn.abcsys.cloud.devops.web.entity.UserRoleEnvProj;

/**
 * 用户角色信息接口
 * @author xzg
 *
 */
public interface UserRoleEnvProjMapper {

	/**
	 * 查询
	 * @param userRole
	 * @return
	 */
	public List<UserRoleEnvProj> selectByUREP(UserRoleEnvProj userRole) throws SQLException;
	
	/**
	 * @param id
	 * @return
	 * @throws SqlException
	 */
	public UserRoleEnvProj selectByPrimaryKey(Integer id) throws SQLException;
	
	/**
	 * @param userId
	 * @return
	 * @throws SqlException
	 */
	public int deleteByUserIdenvId(@Param("userId")Integer userId,@Param("envId")Integer envId) throws SQLException;
	
	/**
	 * @param id
	 * @return
	 * @throws SqlException
	 */
	public int deleteByPrimaryKey(Integer id) throws SQLException;
	
	/**
	 * @param record
	 * @return
	 * @throws SqlException
	 */
	public int insert(UserRoleEnvProj urep) throws SQLException;
	
	/**
	 * @param record
	 * @return
	 * @throws SqlException
	 */
	public int insertSelective(UserRoleEnvProj record) throws SQLException;
	
	/**
	 * 为用户批量增加角色、环境、项目
	 * @param ure
	 * @return
	 * @throws SQLException
	 */
	public int insertListUREJ(List<UserRoleEnvProj> urepList) throws SQLException;
	
	/**
	 * 为用户批量删除本环境下的角色
	 * @param ure
	 * @throws SQLException
	 */
	public void deleteByUserIdEnvId(UserRoleEnvProj urep) throws SQLException;
	/**
	 * @param record
	 * @return
	 * @throws SqlException
	 */
	public int updateByPrimaryKeySelective(UserRoleEnvProj record) throws SQLException;

}
